﻿
//news页默认加载项
function NewsLoad() {
    SideKp("kp");
}

//ajax加载kp数据
function SideKp(kp) {
    var kid = "side_kp_1";
    if (kp == "bkp")
        kid = "side_kp_2";
    $.get("./Handler/SideKp.ashx", { Action: "get", ac: kp }, function (data, textStatus) {
        if (textStatus == 'success')
            $("#" + kid).html(data);
        else
            $("#" + kid).html('<img src="http://down3.emstock.com.cn/www/images/loading.gif" />');
    });
}

//kp选项卡
function tabKp(kp) {
    if (kp == "bkp") {
        $("#kp_2").attr("className", "news_r_nav_1 news_r_nav_on");
        $("#kp_2").css({ "font-weight": "bold" });
        $("#kp_1").attr("className", "news_r_nav_1");
        $("#kp_1").css({ "font-weight": "normal" });
        $("#side_kp_1").toggle();
        $("#side_kp_2").toggle();
        SideKp("bkp");
    } else {
        $("#kp_1").attr("className", "news_r_nav_1 news_r_nav_on");
        $("#kp_1").css({ "font-weight": "bold" });
        $("#kp_2").attr("className", "news_r_nav_1");
        $("#kp_2").css({ "font-weight": "normal" });
        $("#side_kp_1").toggle();
        $("#side_kp_2").toggle();
    }
}

//news内容页默认加载项
function NewsConLoad() {
    tabKpNum("");


    //涉及股票
    var obj = $("[sjgp=true]");
    $(obj[0]).children("li:eq(0)").children("img").attr("src", "http://down3.emstock.com.cn/www/images/report_ico3.jpg");
    $(obj[0]).next("div").show();
    $(obj).mousemove(function () {
        for (var i = 0; i < $(obj).length; i++) {
            $(obj[i]).children("li:eq(0)").children("img").attr("src", "http://down3.emstock.com.cn/www/images/report_ico2.jpg");
        }
        $("[sjgpd=true]").hide();
        $(this).children("li:eq(0)").children("img").attr("src", "http://down3.emstock.com.cn/www/images/report_ico3.jpg");
        $(this).next("div").show();
    });

    //绑定涉及股票的最新价
    var spans = $("[zxj=zxj]");
    var zdf = $("[zdf=zdf]");
    var codes = "";
    for (var i = 0; i < spans.length; i++) {
        codes += $(spans[i]).attr("code") + ",";
    }
    if (codes.length > 0) {
        codes = codes.substring(0, codes.length - 1);
        $.getJSON("Handler/StockPrice.ashx", { code: codes, aa: Math.random() }, function (data) {
            $(data).each(function (i) {
                for (var j = 0; j < spans.length; j++) {
                    if ($(spans[j]).attr("code") == data[i].C) {
                        $(spans[j]).html(formatNumber(data[i].P, 2));
                        $(zdf[j]).html(" " + formatNumber(data[i].F, 2) + "%");
                        if (data[i].F >= 0) {
                            $(spans[j]).attr("className", "report_r_sjgp_2 red");
                            $(zdf[j]).attr("className", "report_r_sjgp_2 red");
                        }
                        else {
                            $(spans[j]).attr("className", "report_r_sjgp_2 green");
                            $(zdf[j]).attr("className", "report_r_sjgp_2 green");
                        }
                    }
                }
            })
        })
    }


    // 反写页面内容行情相关链接
    var ca = $("[ca=true]");
    for (var i = 0; i < ca.length; i++) {
        var baseURL = "http://hq.emoney.cn/";
        switch ($(ca[i]).attr("t")) {
            case "1":
                $(ca[i]).html("<a href=\"" + baseURL + "gg" + $(ca[i]).attr("c") + ".shtml\" target=\"_blank\">" + $(ca[i]).html() + "</a>");
                break;
            case "2":
                $(ca[i]).html("<a href=\"" + baseURL + "bk" + $(ca[i]).attr("c") + ".shtml\" target=\"_blank\">" + $(ca[i]).html() + "</a>");
                break;
            case "3":
                $(ca[i]).html("<a href=\"" + baseURL + "dp" + $(ca[i]).attr("c") + ".shtml\" target=\"_blank\">" + $(ca[i]).html() + "</a>");
                break;
            default:
                break;
        }
    }
}

function IsCookie(nid) {
    var rel = false;
    var cooks = $.cookie('ArtRec');
    if (cooks == null) {
        return false;
    }
    var arrCook = cooks.split(',');
    for (var i = 0; i < arrCook.length; i++) {
        if (arrCook[i] == nid)
            rel = true;
    }
    return rel;
}

function WrCookie(nid) {
    var cooks = $.cookie('ArtRec');
    if (cooks == null) {
        $.cookie('ArtRec', nid, { expires: 10000000 });
        return;
    }
    var arrCook = cooks.split(',');
    var arrTmp;
    for (var i = 0; i < arrCook.length; i++) {
        if (arrTmp == null || arrTmp == "")
            arrTmp = nid;
        else
            arrTmp += "," + nid;
    }
    $.cookie('ArtRec', arrTmp, { expires: 10000000 });
}

function tabKpNum(kp) {
 
    var id = $("#hidID").val();
    var _flag = kp;
    var rel = false;

    if (_flag != "") {
        if (IsCookie(id) == true) {
            alert("您已经投过票！\n\n请不要重复投票。");
            return;
        }
        else {
            WrCookie(id);
        }
    }
    $.post("./Handler/SideKp.ashx", { ac: "kpn", newsId: id, flag: _flag }, function (data, textStatus) {
     
        if (data != "") {
            data = eval("(" + data + ")");
            $("#s_kp_1").html(data.kp);
            $("#s_kp_2").html(data.bkp);
        }
    });
}


//必读dayRead.aspx 预加载
function DayReadLoad() {
    var ti = $("#hidTi").val();
    TiTab(ti)
}

//
function TiTab(n) {
    var c = "ti_";
    var t = 3;
    ontab(c, t, n);
}


function XgTab(n) {
    var c = "xg_";
    var t = 2;
    for (var i = 1; i <= t; i++) {
        $("#" + c + i).hide();
        $("#" + c + "Tab_" + i).attr("className", "index_content_m_1_1");
    }
    $("#" + c + n).show();
    $("#" + c + "Tab_" + n).attr("className", "index_content_m_1_1 index_content_m_1_on");
    if (n == 2) {
        $("#ggzs_tab").hide();
        GgfxTab(2);
    }
    else {
        $("#ggzs_tab").show();
        GgfxTab(1);
    }
}

function GgfxTab(n) {
    if (n == 2) {
        $("#ggzs_tab").attr("className", "");
        $("#fxpc_tab").attr("className", "hover");
        $("#ggzs_tab_1").hide();
        $("#fxpc_tab_1").show();
    }
    else {
        $("#ggzs_tab").attr("className", "hover");
        $("#fxpc_tab").attr("className", "");
        $("#ggzs_tab_1").show();
        $("#fxpc_tab_1").hide();
    }
}

function XgNewsTab(n) {
    var len = 2;
    var c = "xnTab1";
    for (var i = 0; i <= len; i++) {
        $("#" + c + "_" + i).hide();
    }
    $("#" + c + "_" + n).show();
    if (n == 2) {
        $("#xnTab1").attr("className", "index_content_m_1_1");
        $("#xnTab2").attr("className", "index_content_m_1_1 index_content_m_1_on");
    }
    else {
        $("#xnTab2").attr("className", "index_content_m_1_1");
        $("#xnTab1").attr("className", "index_content_m_1_1 index_content_m_1_on");
    }
}

//tab选项卡
//c为tab内容前缀
//t为当前tab选项长度
//n为当前选中项
function ontab(c, t, n) {
    for (var i = 1; i <= t; i++) {
        $("#" + c + i).hide();
    }
    if ($("#" + c + n).css('display') == 'none')
        $("#" + c + n).show();
    else
        $("#" + c + n).hide();

}

function reportLoad() {
    re_pr("zxj", "zdf", "zdfv", 1,0);
    //反写code的最新价，涨跌幅
    BindZxj("code2","zxj2", "zdf2");
}

function nStockLoad() {
    re_pr("zxj", "zdf", "zdfv", 1, 1);

}

//反写最新价
//q 为1，判断是否需要涨跌幅
function re_pr(zxj, zdf, zdfv, q, f) {
    var spans = $("[zxj=" + zxj + "]");
    var codes = "";
    for (var i = 0; i < spans.length; i++) {
        codes += $(spans[i]).attr("code") + ",";
    }
    if (codes.length > 0) {
        codes = codes.substring(0, codes.length - 1);
        $.getJSON("Handler/StockPrice.ashx", { code: codes, aa: Math.random() }, function (data) {
            $(data).each(function (i) {
                var stockid = data[i].C;
                var price = data[i].P;
                for (var j = 0; j < spans.length; j++) {
                    if ($(spans[j]).attr("code") == stockid) {
                        $(spans[j]).html(formatNumber(price, 2));
                    }
                }
                if (q == 1)
                    re_zdf(zxj, zdf, zdfv, f);
            })
        })
    }
}

//反写涨跌幅
function re_zdf(zxj, zdf, zdfv, f) {
    var spans = $("[zxj=" + zxj + "]");
    var zdfs = $("[zdf=" + zdf + "]");
    var codes = "";
    for (var i = 0; i < spans.length; i++) {
        var price;
        if ($(spans[i]).html() == "-" || $(zdfs[i]).attr(zdfv) == "" || $(zdfs[i]).attr(zdfv) == 0)
            price = "-";
        else {
            if (f == 1)
                price = $(spans[i]).html() / $(zdfs[i]).attr(zdfv) - 1;
            else
                price = $(zdfs[i]).attr(zdfv) / $(spans[i]).html() - 1;
        }
        $(zdfs[i]).html(formatNumber2(price, 2, "%"));
        if (price >= 0)
            $(zdfs[i]).attr("className", "red");
        else
            $(zdfs[i]).attr("className", "green");
    }
}

//规格化字符
function formatNumber(val, fixed) {
    var number = new Number(val);
    if (number == 0)
        number = "-";
    else
        number = new Number(val).toFixed(fixed)
    return number;
}

//规格化字符 百分比
function formatNumber2(val, fixed, per) {
    var number = new Number(val);

    if (number == 0 || isNaN(number))
        number = "-";
    else
        number = (number * 100).toFixed(fixed) + per;
    return number;
}

//日历 反写板块
function re_bkzd() {
    var bkzs = $("[bkzs=zs]");
    var bkul = $("[bkul=ul]");
    var bkzd = $("[bkzd=zd]");
    var codes = "";
    for (var i = 0; i < bkul.length; i++) {
        codes += $(bkul[i]).attr("bkcode") + ",";
    }
    if (codes != "") {
        codes = codes.substring(0, codes.length - 1);
        $.getJSON("Handler/CalendarBk.ashx", { codes: codes, aa: Math.random() }, function (data) {
            $(data).each(function (i) {
                for (var j = 0; j < bkul.length; j++) {
                    if ($(bkul[j]).attr("bkcode") == data[i].C) {
                        $(bkzd[j]).html(formatNumber(data[i].D,2) + " " + data[i].F + "%");

                        if (data[i].D >= 0) {
                            $(bkzd[j]).attr("className", "red");
                            $(bkzs[j]).html(formatNumber(data[i].P,2) + "<img src=\"http://down3.emstock.com.cn/www/images/rili/up.png\" />");
                        }
                        else {
                            $(bkzd[j]).attr("className", "green");
                            $(bkzs[j]).html(formatNumber(data[i].P, 2) + "<img src=\"http://down3.emstock.com.cn/www/images/rili/down.png\" />");
                        }
                    }
                }
            })
        })
    }
}

function GetSSZhiShu() {
    $.get("Handler/StockPrice.ashx", { ac: "zhishu", aa: Math.random() }, function (data) {
        if (data != null) {
            $("#sszhishu").html(data);
        }
    });
}




//处理页面上png图片背景
function correctPNG() {
    for (var i = 0; i < document.images.length; i++) {
        var img = document.images[i]
        var imgName = img.src.toUpperCase()
        if (imgName.substring(imgName.length - 3, imgName.length) == "PNG") {
            var imgID = (img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
   + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
   + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
            img.outerHTML = strNewHTML
            i = i - 1
        }
    }
}
//处理页面上png图片背景 结束

//实时刷新首页指数信息
function IdxZs() {
    var qurl = "http://www.ymcps.com/";
    switch ($("#hidZs").val()) {
        case "1":
            $.post("./Handler/StockPrice.ashx", { ac: "idxzs2", code: "000001", m: Math.random() }, function (data, textStatus) {
                $("#hqimg div:eq(1)").children("div:eq(0)").html(data);
                $("#hqimg div:eq(1)").children("div:eq(1)").children("img").attr("src", "" + qurl + "/images/zhishu/000001.jpg?" + Math.random() + "");
            });
            break;
        case "2":
            $.post("./Handler/StockPrice.ashx", { ac: "idxzs2", code: "399001", m: Math.random() }, function (data, textStatus) {
                $("#hqimg div:eq(1)").children("div:eq(0)").html(data);
                $("#hqimg div:eq(1)").children("div:eq(1)").children("img").attr("src", "" + qurl + "/images/zhishu/399001.jpg?" + Math.random() + "");
            });
            break;
        case "3":
            $.post("./Handler/StockPrice.ashx", { ac: "idxzs2", code: "399101", m: Math.random() }, function (data, textStatus) {
                $("#hqimg div:eq(1)").children("div:eq(0)").html(data);
                $("#hqimg div:eq(1)").children("div:eq(1)").children("img").attr("src", "" + qurl + "/images/zhishu/399101.jpg?" + Math.random() + "");
            });
            break;
        case "4":
            $.post("./Handler/StockPrice.ashx", { ac: "idxzs2", code: "399006", m: Math.random() }, function (data, textStatus) {
                $("#hqimg div:eq(1)").children("div:eq(0)").html(data);
                $("#hqimg div:eq(1)").children("div:eq(1)").children("img").attr("src", "" + qurl + "/images/zhishu/399006.jpg?" + Math.random() + "");
            });
            break;
        case "5":
            $.post("./Handler/StockPrice.ashx", { ac: "idxzs2", code: "000300", m: Math.random() }, function (data, textStatus) {
                $("#hqimg div:eq(1)").children("div:eq(0)").html(data);
                $("#hqimg div:eq(1)").children("div:eq(1)").children("img").attr("src", "" + qurl + "/images/zhishu/000300.jpg?" + Math.random() + "");
            });
            break;
        case "6":
            $.post("./Handler/StockPrice.ashx", { ac: "idxzs", m: Math.random() }, function (data, textStatus) {
                $("#hqimg div:eq(1)").children("div:eq(0)").html(data);
                $("#hqimg div:eq(1)").children("div:eq(1)").hide();
            });
            break;
    }
}

//加载首页预加载js内容
function IdxLoad() {
    //预加载行情图
    var qurl = "http://www.ymcps.com/";
    $.post("./Handler/StockPrice.ashx", { ac: "idxzs2", code: "000001", m: Math.random() }, function (data, textStatus) {
        $("#hqimg div:eq(1)").children("div:eq(0)").html(data);
        $("#hqimg div:eq(1)").children("div:eq(1)").children("img").attr("src", "" + qurl + "/images/zhishu/000001.jpg?" + Math.random() + "");
    });
    $("#hqimg li").click(function () {
        $("#hqimg li").attr("className", "index_content_m_1_1");
        $(this).attr("className", "index_content_m_1_1 index_content_m_1_on");
        $("#hidZs").val($(this).attr("a1"));
        $("#hqimg div:eq(1)").children("div:eq(1)").show();
        switch ($(this).attr("a1")) {
            case "1":
                $.post("./Handler/StockPrice.ashx", { ac: "idxzs2", code: "000001", m: Math.random() }, function (data, textStatus) {
                    $("#hqimg div:eq(1)").children("div:eq(0)").html(data);
                    $("#hqimg div:eq(1)").children("div:eq(1)").children("img").attr("src", "" + qurl + "/images/zhishu/000001.jpg?" + Math.random() + "");
                });
                break;
            case "2":
                $.post("./Handler/StockPrice.ashx", { ac: "idxzs2", code: "399001", m: Math.random() }, function (data, textStatus) {
                    $("#hqimg div:eq(1)").children("div:eq(0)").html(data);
                    $("#hqimg div:eq(1)").children("div:eq(1)").children("img").attr("src", "" + qurl + "/images/zhishu/399001.jpg?" + Math.random() + "");
                });
                break;
            case "3":
                $.post("./Handler/StockPrice.ashx", { ac: "idxzs2", code: "399101", m: Math.random() }, function (data, textStatus) {
                    $("#hqimg div:eq(1)").children("div:eq(0)").html(data);
                    $("#hqimg div:eq(1)").children("div:eq(1)").children("img").attr("src", "" + qurl + "/images/zhishu/399101.jpg?" + Math.random() + "");
                });
                break;
            case "4":
                $.post("./Handler/StockPrice.ashx", { ac: "idxzs2", code: "399006", m: Math.random() }, function (data, textStatus) {
                    $("#hqimg div:eq(1)").children("div:eq(0)").html(data);
                    $("#hqimg div:eq(1)").children("div:eq(1)").children("img").attr("src", "" + qurl + "/images/zhishu/399006.jpg?" + Math.random() + "");
                });
                break;
            case "5":
                $.post("./Handler/StockPrice.ashx", { ac: "idxzs2", code: "000300", m: Math.random() }, function (data, textStatus) {
                    $("#hqimg div:eq(1)").children("div:eq(0)").html(data);
                    $("#hqimg div:eq(1)").children("div:eq(1)").children("img").attr("src", "" + qurl + "/images/zhishu/000300.jpg?" + Math.random() + "");
                });
                break;
            case "6":
                $.post("./Handler/StockPrice.ashx", { ac: "idxzs", m: Math.random() }, function (data, textStatus) {
                    $("#hqimg div:eq(1)").children("div:eq(0)").html(data);
                    $("#hqimg div:eq(1)").children("div:eq(1)").hide();
                });
                break;
        }
    });

    //
    setInterval(IdxZs,1000*30);

    //涨跌板块
    $("#tblzd li").click(function () {
        $("#tblzd li").attr("className", "index_content_m_1_1");
        $(this).attr("className", "index_content_m_1_1 index_content_m_1_on");
        $("#tblzd_1").attr("className", "hide");
        $("#tblzd_2").attr("className", "hide");
        $("#tblzd_" + $(this).attr("a2")).attr("className", "show");
    });
    //
    $("#tbzl li").click(function () {
        $("#tbzl li").attr("className", "index_content_m_1_1");
        $(this).attr("className", "index_content_m_1_1 index_content_m_1_on");
        $("#tbzl_1").attr("className", "hide");
        $("#tbzl_2").attr("className", "hide");
        $("#tbzl_" + $(this).attr("a3")).attr("className", "show");
    });
    //
    $("#tbPool li").click(function () {
        $("#tbPool li").attr("className", "index_content_m_1_1");
        $(this).attr("className", "index_content_m_1_1 index_content_m_1_on");
        $("#tbPool_1").attr("className", "hide");
        $("#tbPool_2").attr("className", "hide");
        $("#tbPool_" + $(this).attr("a4")).attr("className", "show");
    });
    //
    $("#tbjg li").click(function () {
        $("#tbjg li").attr("className", "index_content_m_1_1");
        $(this).attr("className", "index_content_m_1_1 index_content_m_1_on");
        $("#tbjg_1").attr("className", "hide");
        $("#tbjg_2").attr("className", "hide");
        $("#tbjg_" + $(this).attr("a5")).attr("className", "show");
    });
    //
    $("#tabgsbb li").click(function () {
        $("#tabgsbb li").attr("className", "index_content_m_1_1");
        $(this).attr("className", "index_content_m_1_1 index_content_m_1_on");
        $("#tabgsbb_1").attr("className", "hide");
        $("#tabgsbb_2").attr("className", "hide");
        $("#tabgsbb_" + $(this).attr("a6")).attr("className", "index_content_m_2_c show");
    });
    //益盟视点
    $("#ymsd li").click(function () {
        $("#ymsd li").attr("className", "index_content_m_1_1");
        $(this).attr("className", "index_content_m_1_1 index_content_m_1_on");
        $("#ymsd_1").attr("className", "hide");
        $("#ymsd_2").attr("className", "hide");
        $("#ymsd_" + $(this).attr("a7")).attr("className", "show");
    });
    //独家特色推荐
    $("#sbTab li").mousemove(function () {
        $("[class=ac_results]").hide();
        var stab = $("[a8_1=true]");
        for (var i = 0; i < stab.length; i++) {
            if ($(this).attr("a8_1") == "true") {
                $(stab[i]).attr("className", "bg");
                $("#sbTab_" + $(stab[i]).attr("a8")).attr("className", "tuijian hide");
            }
        }
        if ($(this).attr("a8_1") == "true") {
            $(this).attr("className", "bg2");
            $("#sbTab_" + $(this).attr("a8")).attr("className", "tuijian show");
        }
    });

    //天气预报
    $("#showWeather").hover(function () {
        $("#sweather").attr("className", "bd show");
        $("#showWeatherText").attr("className", "index_forecast_text2");
    }, function () {
        $("#sweather").attr("className", "bd hide");
        $("#showWeatherText").attr("className", "index_forecast_text");
    });

    //股票检查
    $.get("./Handler/StockPrice.ashx", { ac: "doctor", code: "600000", m: Math.random() }, function (data, textStatus) {
        $("#divDoctor").html(data);
    });
    $("#btnDoctor").click(function () {
        var code = "600000";
        if ($("#dcode").val() != "")
            code = $("#dcode").val();
        $.get("./Handler/StockPrice.ashx", { ac: "doctor", code: code, m: Math.random() }, function (data, textStatus) {
            $("#divDoctor").html(data);
        });
    });

    //操盘手乾坤版·体验版下载体验统计
    $.get("./Handler/IdxCookie.ashx", { ac: "down", key: "qkxzty", v: "0", m: Math.random() }, function (data) {
        $("#qkxzty_span").html("<b>" + data + "</b>");
    });
    $("#qkxzty").click(function () {
        $.get("./Handler/IdxCookie.ashx", { ac: "down", key: "qkxzty", v: "1", m: Math.random() }, function (data) {
            $("#qkxzty_span").html("<b>" + data + "</b>");
        });
        window.open('http://down.emoney.cn/wl0401281.exe');
        return false;
    });
    //业手机炒股软件下载体验统计
    $.get("./Handler/IdxCookie.ashx", { ac: "down", key: "xzty", v: "0", m: Math.random() }, function (data) {
        $("#xzty_span").html("<b>" + data + "</b>");
    });
    $("#xzty").click(function () {
        $.get("./Handler/IdxCookie.ashx", { ac: "down", key: "xzty", v: "1", m: Math.random() }, function (data) {
            $("#xzty_span").html("<b>" + data + "</b>");
        });
        window.open('http://cell.emoney.cn/');
        return false;
    });
}



//反写code的最新价，涨跌幅
function BindZxj(cid,zxj, zdf) {
    var spans = $("[zxj=" + zxj + "]");
    var zdfs = $("[zdf=" + zdf + "]");
    var codes = "";
    for (var i = 0; i < spans.length; i++) {
        codes += $(spans[i]).attr(cid) + ",";
    }

    if (codes.length > 0) {
        codes = codes.substring(0, codes.length - 1);
        $.getJSON("Handler/StockPrice.ashx", { code: codes, aa: Math.random() }, function (data) {
            $(data).each(function (i) {
                var stockid = data[i].C;
                //var price = data[i].P;
                for (var j = 0; j < spans.length; j++) {
                    if ($(spans[j]).attr(cid) == stockid) {
                        $(spans[j]).html(formatNumber(data[i].P, 2));
                        $(zdfs[j]).html(formatNumber(data[i].F, 2));
                        if (formatNumber(data[i].F, 2) < 0) {
                            $(spans[j]).attr("className", "green");
                            $(zdfs[j]).attr("className", "green");
                        }
                        else {
                            $(spans[j]).attr("className", "red");
                            $(zdfs[j]).attr("className", "red");
                        }
                    }
                }
            })
        })
    }
}
